const glob = require('glob');
const path = require('path');
const {PAGES_PATH} = require('./paths');

function getEntry () {
    let entry = {};
    let pattern = path.resolve(PAGES_PATH, '*.js');
    glob.sync(pattern).forEach(function (filePath) {
        let name = filePath.slice(filePath.lastIndexOf('/') + 1, filePath.length - 3);
        entry[name] = filePath;
    });
    return entry;
}

const entry = getEntry();

module.exports = entry;
